binary_link Derived Type

type, public, extends(link) :: binary_link

Defines a link consisting of only two joints. The coordinate system of this link is situated at the distal joint with it's z-axis coincident with the axis of the joint. The link utilizes a Denavit-Hartenberg convention in order to express its geometry.


Contents


Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: cg(3)

The x-y-z location of the CG relative to the body coordinate frame.

real(kind=real64), public :: inertia(3,3)

The 3-by-3 inertia tensor as measured about the CG of the body.

real(kind=real64), public :: joint_angle

The joint angle is the required rotation of the previous link's x-axis about the proximal joint's axis to become parallel to the current link's x-axis.

integer(kind=int32), public :: joint_type

The proximal joint type. This value must be either REVOLUTE_JOINT or PRISMATIC_JOINT.

real(kind=real64), public :: link_length

The link length is the distance between the proximal and distal joint axes as measured along the link's x-axis.

real(kind=real64), public :: link_offset

The link offset is the fixed distance between the previous link's x-axis and the current link's x-axis as measured along the axis of the proximal joint.

real(kind=real64), public :: link_twist

The link twist is the required rotation of the proximal joint axis about the link's x-axis to become parallel to the distal joint's axis.

real(kind=real64), public :: mass

The mass of the body.


Constructor

public interface binary_link

  • private pure function bl_init(jtype, length, twist, offset, angle, mass, inertia, cg) result(rst)

    Initializes a new parallel_revolute_revolute_link instance.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in), optional :: jtype

    The proximal joint type. This value must be either & REVOLUTE_JOINT or PRISMATIC_JOINT. If incorrectly specified, this parameter defaults to REVOLUTE_JOINT.

    real(kind=real64), intent(in), optional :: length

    The link length. If no value is specified, a value of 0 is used.

    real(kind=real64), intent(in), optional :: twist

    The link twist angle. If no value is specified, a value of 0 is used.

    real(kind=real64), intent(in), optional :: offset

    The link offset. If no value is specified, a value of 0 is used.

    real(kind=real64), intent(in), optional :: angle

    The joint angle offset. If no value is specified, a value of 0 is used.

    real(kind=real64), intent(in), optional :: mass

    The mass of the link. If no value is specified, a value of 1 is used.

    real(kind=real64), intent(in), optional :: inertia(3,3)

    The 3-by-3 inertia tensor. If not specified, an identity matrix is used.

    real(kind=real64), intent(in), optional :: cg(3)

    The x-y-z location of the CG relative to the distal coordinate frame, expressed in the link coordinate frame. If not supplied, the CG is set to (0, 0, 0) such that it is located at the center of the distal joint.

    Return Value type(binary_link)

    The resulting binary_link object.


Type-Bound Procedures

procedure, public :: get_joint_count => bl_get_joint_count

  • private pure function bl_get_joint_count(this) result(rst)

    Gets the number of joint coordinate frames carried by the link. A binary link always carries two frames.

    Arguments

    Type IntentOptional Attributes Name
    class(binary_link), intent(in) :: this

    The binary_link object.

    Return Value integer(kind=int32)

    The number of joint coordinate frames.

procedure, public :: get_joint_frame => bl_get_joint_frame

  • private pure function bl_get_joint_frame(this, i) result(rst)

    Gets the transformation matrix relating the requested joint coordinate frame to the link's body coordinate frame. The first frame is the proximal joint, and the second frame is the distal joint. As the body coordinate frame of a binary link is situated at the distal joint, the second frame is the identity matrix. The frames are established with the joint variable set to zero.

    Arguments

    Type IntentOptional Attributes Name
    class(binary_link), intent(in) :: this

    The binary_link object.

    integer(kind=int32), intent(in) :: i

    The index of the joint coordinate frame (1 = proximal joint).

    Return Value real(kind=real64), (4,4)

    The resulting 4-by-4 transformation matrix.